<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // try{
        //     console.log(a);
        // }catch(err){
        //     console.log(22)
        //     console.log(err)
        // }
        // console.log(222)
        function fn(num){
            if(typeof num!=='number'){
                const err=new Error('参数必须是数值类型')
                console.log(err)
             
                throw(err)
                console.log(333)
            }
        }
        fn('aaaa')
    </script>
    
</body>
</html>